/*
 * \file XmlPath.h
 *
 * \date Created on: Jan 26, 2009
 * \author sarah
 */

#ifndef XMLPATH_H_
#define XMLPATH_H_

#include <QDir>

class XmlPath
{
public:
    enum BaseTypes
    {
        CLASS_BASE,
        RACIAL_BASE,
        EQUIPMENT_BASE,
        FEAT_BASE,
        SKILL_BASE,
        CHARACTER_BASE
    };

    static const int NUM_BASE_TYPES = 6;
    static const char *BASE_TYPE_NAMES[];

    enum SubTypes
    {
        POWER_TYPE,
        TRAIT_TYPE,
        NO_TYPE
    };

    static const int NUM_SUB_TYPES = 3;
    static const char *SUB_TYPE_NAMES[];

    XmlPath();
    explicit XmlPath(BaseTypes, const QString &baseName = QString());
    XmlPath(const XmlPath &rhs);
    virtual ~XmlPath();
    QDir dir() const;
    QString path() const;
    BaseTypes type() const;
    SubTypes subType() const;
    QString typeName() const;
    QString objectName() const;
    bool valid() const;
    void setType(BaseTypes mType);
    void setTypeName(QString mTypeName);
    void setSubType(SubTypes subType);
    void setObjectName(QString mObjectName);
    XmlPath &operator=(const XmlPath &rhs);

    static QString safeDataPathName(const QString &name);

private:
    BaseTypes mType;
    SubTypes mSubType;
    QString mTypeName;
    QString mObjectName;
    bool mValid;
};

#endif /* XMLPATH_H_ */
